/*刻度盘类*/
public class DialSense {
	private int dialPosition;  //刻度盘位置
	private PowerStatus powerStatus;//电源状态
	
	//构造函数
	public DialSense()
	{
		dialPosition = 1; //刻度盘起始位置： 1
		powerStatus = PowerStatus.OFF;  //电源起始状态：关闭
	}
	
	//构造带参数的刻度盘类
	public DialSense(PowerStatus statPower,int nPos)
	{
		dialPosition = nPos; //刻度盘位置
		powerStatus = statPower;  //电源状态
	}
	
	//增加刻度盘,只有带电才起作用。
	public void Increment()
	{
		if( PowerStatus.OFF == powerStatus )
			return;
		if( 1==dialPosition )	
			dialPosition = 2;
		else if( 2==dialPosition )	
			dialPosition = 3;
		else 
			dialPosition = 3;
	}
	
	//调小刻度盘,只有带电才起作用。
	public void Decrement()
	{
		if( PowerStatus.OFF == powerStatus )
			return;
		if( 3==dialPosition )	
			dialPosition = 2;
		else if( 2==dialPosition )	
			dialPosition = 1;
		else 
			dialPosition = 1;
	}
	
	//获得刻度盘指针
	public int GetDialPosition()
	{
		return dialPosition;
	}
	
	//设定刻度盘指针。
	public void SetDialPosition(int nPos)
	{
		dialPosition = nPos;
	}
	
	//改变电源状态
	public void SetPowerStatus( PowerStatus statPower )
	{
		powerStatus = statPower;
	}
}
